{% load codalab_tags %}

{#<h1>Files</h1>#}
{% if competition.has_starting_kit_or_public_data %}
    <table style="border: 1px solid rgba(0,0,0,0.3)" class="table table-responsive">
        <thead>
        <th>
            Download
        </th>
        <th>
            Size (mb)
        </th>
        <th>
            Phase
        </th>
        </thead>
        <tbody>
        {% for phase in competition.phases.all %}
            {% if phase and phase.starting_kit_organizer_dataset %}
                <tr>
                    <td>
                        <a href="{% url 'datasets_download' dataset_key=phase.starting_kit_organizer_dataset.key %}"
                           class="btn btn-primary phase-btn-{{ phase.color }}">{{ phase.starting_kit_organizer_dataset.type }}</a>
                    </td>
                    <td style="padding-top: 12px;">
                        {{ phase.get_starting_kit_size_mb|floatformat:3 }}
                    </td>
                    <td style="padding-top: 12px;">
                        #{{ phase.phasenumber }} {{ phase.label }}
                    </td>
                </tr>
            {% endif %}
            {% if phase and phase.public_data_organizer_dataset %}
                <tr>
                    <td>
                        <a href="{% url 'datasets_download' dataset_key=phase.public_data_organizer_dataset.key %}"
                           class="btn btn-primary phase-btn-{{ phase.color }}">{{ phase.public_data_organizer_dataset.type }}</a>
                    </td>
                    <td style="padding-top: 12px;">
                        {{ phase.get_public_data_size_mb|floatformat:3 }}
                    </td>
                    <td style="padding-top: 12px;">
                        #{{ phase.phasenumber }} {{ phase.label }}
                    </td>
                </tr>
            {% endif %}
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <i>No files have been added for this competition yet.</i>
{% endif %}
